﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace Argos.Windows.Forms
{
	public partial class UriEditorDialog: Form
	{
		public UriEditorDialog()
		{
			InitializeComponent();
		}

		public Uri SelectedUri
		{
			get { return new Uri(this.UriTextbox.Text); }
			set { this.UriTextbox.Text = string.Format("{0}", value); }
		}

		private void OK_Click(object sender, EventArgs e)
		{
			this.DialogResult = DialogResult.OK;
			this.Close();
		}

		private void BrowseLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			Process.Start(this.UriTextbox.Text);
		}

		private void UriTextbox_TextChanged(object sender, EventArgs e)
		{
			this.BrowseLabel.Enabled = !string.IsNullOrEmpty(this.UriTextbox.Text);
		}
	}
}
